package y23.Dec;

import java.math.BigInteger;

public class Test9 {
    public static void main(String[] args) {
        BigInteger sum = new BigInteger("0");
        for (int i = 0; i < 50; i++) {
            sum = sum.add(ret(i));
        }
        System.out.println(sum);
    }
    public static BigInteger ret(int i){
        BigInteger sum = new BigInteger("1");
        while(i > 1){
            sum = sum.multiply(BigInteger.valueOf(i));
            i--;
        }
        System.out.println(sum);
        return sum;
    }
}
